//============================================================================
// Name        : ms011.cpp
// Author      : Tadas
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

#include "lib.h"


void funkcija( double t, double * y, double * deriv){
	deriv[0] = y[1];
	deriv[1] = -y[0];
}


int main() {
	
	int ipoint = 30;
	double ** y = allocate2d(2, ipoint);
	double *x = new double[ipoint];
	x[0] = 0.0;
	y[0][0] = 1.0;
	y[1][0] = 0.0;
	
	RK4solver(y, x, ipoint, funkcija);
	
	for(int i = 0; i < 2; i++){
		cout << "i: " << i << endl;
		for(int k = 0; k < ipoint; k++){
			cout <<"x: " << x[k] <<  " Val: " << y[i][k] << endl;
		}
	}
	
	return 0;
}
